#define MATH_VECTOR_SCALAR_MULT_EQU_OP( TYPE )     \
template< typename T, unsigned int N >             \
Vector<T,N> operator*=( Vector<T,N>& a, TYPE b ) { \
  for( unsigned int i = 0; i < N; ++i ) {          \
    a[i] *= b;                                     \
  }                                                \
  return a;                                        \
}                                                  \

#define MATH_VECTOR_SCALAR_DIV_EQU_OP( TYPE )      \
template< typename T, unsigned int N >             \
Vector<T,N> operator/=( Vector<T,N>& a, TYPE b ) { \
  for( unsigned int i = 0; i < N; ++i ) {          \
    a[i] /= b;                                     \
  }                                                \
  return a;                                        \
}                                                  \

#define MATH_VECTOR_SCALAR_MULT_OP( TYPE )              \
template< typename T, unsigned int N >                  \
Vector<T,N> operator*( const Vector<T,N>& a, TYPE b ) { \
  Vector<T,N> temp(a);                                  \
  temp *= b;                                            \
  return temp;                                          \
}                                                       \

#define MATH_VECTOR_SCALAR_DIV_OP( TYPE )               \
template< typename T, unsigned int N >                  \
Vector<T,N> operator/( const Vector<T,N>& a, TYPE b ) { \
  Vector<T,N> temp(a);                                  \
  temp /= b;                                            \
  return temp;                                          \
}                                                       \

#define MATH_SCALAR_VECTOR_MULT_OP( TYPE )              \
template< typename T, unsigned int N >                  \
Vector<T,N> operator*( TYPE b, const Vector<T,N>& a ) { \
  Vector<T,N> temp(a);                                  \
  temp *= b;                                            \
  return temp;                                          \
}                                                       \

#define MATH_APPLY_SCALER_TO_VECTOR( TYPE )    \
MATH_VECTOR_SCALAR_MULT_EQU_OP(TYPE)           \
MATH_VECTOR_SCALAR_DIV_EQU_OP(TYPE)            \
MATH_VECTOR_SCALAR_MULT_OP(TYPE)               \
MATH_VECTOR_SCALAR_DIV_OP(TYPE)                \
MATH_SCALAR_VECTOR_MULT_OP(TYPE)               \

// Defaults
MATH_APPLY_SCALER_TO_VECTOR(int)
MATH_APPLY_SCALER_TO_VECTOR(float)
MATH_APPLY_SCALER_TO_VECTOR(double)

